<template>
<div>消费者
  <el-button @click="toCircle">楼市圈</el-button>
  <el-button @click="toTalk">聊天</el-button>
  <div>
    <el-table
      :data="houseList"
      style="width: 100%"
      @row-click="look">
      <el-table-column
        prop="id"
        label="id"
        width="180">
      </el-table-column>
      <el-table-column
        prop="houseTitle"
        label="房名"
        width="180">
      </el-table-column>
    </el-table>
  </div>
</div>
</template>
<script>
import { findHouseList, addWatchNum } from '@/api/consumer/consumer'
export default {
  name: 'Index',
  data() {
    return {
      // 房源列表
      houseList: []
    }
  },
  created() {
    this.list()
  },
  methods: {
    look(val) {
      addWatchNum(val).then()
      this.list()
    },
    // 房源列表
    list() {
      findHouseList().then(res => {
        this.houseList = res.data
      })
    },
    toCircle() {
      this.$router.push({
        path: '/consumer/houseCircle'
      })
    },
    toTalk() {
      this.$router.push({
        path: '/consumer/messagePage'
      })
    }
  }
}
</script>
<style scoped>
</style>
